Field of the Invention
The present invention relates to an image capturing apparatus and a method for controlling the same, and particularly relates to a technique for recording video data.
Description of the Related Art
Conventional image capturing apparatuses such as digital cameras perform demosaicing processing on raw image signals (referred to as “RAW image”) captured by an image sensor, convert the raw image signals into signals constituted by a luminance and a color difference, and subject each signal to development processing such as noise removal, distortion correction, and magnification chromatic aberration correction. The luminance signals and color difference signals that were ordinarily subjected to the development processing are compressed and encoded, and are recorded in a recording medium.
On the other hand, there are also image capturing apparatuses that can record RAW images. RAW images have an enormous amount of data that needs to be recorded, but have the advantages that degradation thereof can be suppressed to minimum and editing after image-capturing is possible, since RAW images are data on which no development processing has been performed and thus are not subjected to the above-described correction processing. In view of such advantages, RAW images are used on a priority basis in the field of business.
In recent years, due to an increase in the number of pixels of an image sensor and in the number of continuous shots per unit time, processing amounts of the above-described development processing performed on RAW images are synergistically increased, leading to an increase in the circuit size and power consumption that are needed for performing development processing in real time in parallel to image capturing.
Accordingly, image capturing apparatuses are known that distribute loads of development processing by performing development processing (referred to as “follow-up development processing”) on RAW images recorded temporarily at the time of shooting in a state in which the processing load is relatively low, such as a stand-by state for waiting for a user operation or a shooting preparation state.
Ordinarily, since a RAW image has a large amount of data, compressing and encoding processing is performed on the RAW image so as not to suppress the capacity of a recording medium even when the RAW image is temporarily recorded. Therefore, the image capturing apparatus generates data (referred to as “encoded RAW image”) obtained by encoding the RAW image, and then records the encoded RAW image. Note that when follow-up development processing is performed, the encoded RAW image is decoded and then subjected to development processing.
Meanwhile, various approaches have been made with respect to ordinary encoding techniques, and compression rates and processing times thereof are different from each other. Therefore, a technique in which a plurality of encoding techniques are switched and used according to the required property has been proposed. Specifically, a technique has been proposed in which adaptive switching between a lossless encoding method and a lossy encoding method is performed according to the content, which is a compression target, such as a text or a natural image, for each area (Japanese Patent Laid-Open No. 2008-109195).
Generally, follow-up development processing is performed when the apparatus waits for a user operation, such as in a period between shootings, in a reproduction mode, or in a sleep state. However, if shooting is continued at a regular interval or if continuous shooting, moving image shooting, or the like is performed for a prolonged time, there will be a lack of time for the follow-up development processing.
Change in the amount of data in a recording medium in which an encoded RAW image is recorded will be described with reference to FIGS. 2A to 2D. FIGS. 2A to 2D schematically show the amounts of data in the recording medium, in which shaded areas show the amounts of free space of the recording medium. FIGS. 2A and 2B show the change in the amount of data in the recording medium when a time for follow-up development processing is ensured and this follow-up development processing is executed. On the other hand, FIGS. 2C and 2D show the change in the amount of data in the recording medium when there is a lack of time needed for follow-up development processing.
In the recording medium immediately after shooting that is shown in FIG. 2A, an encoded RAW image 201 that was recorded at the time of shooting, and encoded moving image data 202 and encoded still image data 203 that were recorded before shooting are recorded, and a free space 206 is present. The encoded moving image data 202 is generated by decoding and developing the encoded RAW image and then encoding the decoded and developed RAW image with, for example, the H.264 encoding format. The encoded still image data 203 is generated by decoding and developing the encoded RAW image and then encoding the decoded and developed RAW image with the JPEG2000 format.
FIG. 2B shows the amounts of data in the recording medium after follow-up development processing is executed in the state of FIG. 2A. Moving image data of the encoded RAW image 201 is subjected to the H.264 format encoding processing and then added to the data amount of the encoded moving image data 202, serving as encoded moving image data 204. Still image data of the encoded RAW image 201 is subjected to the JPEG2000 format encoding processing and then added to the data amount of the encoded still image data 203, serving as encoded still image data 205. The encoded RAW image 201 is deleted from the recording medium at the time of being converted into H.264 or JPEG, and thus the data amount of the encoded RAW image 201 is 0 in FIG. 2B. Accordingly, the free space 206 of FIG. 2A is increased to a free space 207 of FIG. 2B.
FIG. 2C shows the amounts of data in the recording medium immediately after shooting of FIG. 2A. FIG. 2D shows the state of the recording medium in which the shooting is further continued from the state of FIG. 2C and there is a lack of time for performing follow-up development processing. Since the shooting is continued, an amount of data of a newly recorded encoded RAW image is added to the encoded RAW image 201, and the free space 206 of the recording medium is occupied by an encoded RAW image 208.
In contrast, it is conceivable to ensure a free space of the recording medium by encoding a RAW image using an encoding method having a predetermined property, for example, an encoding method having a high compression rate. However, ordinarily, an encoding method having a high compression rate needs an enormous amount of computation and, when, for example, a sufficient free space remains or high-speed decoding processing is desired to be performed, it may be desirable to use an encoding method that needs a small amount of computation or another appropriate encoding method. Accordingly, it is required to change the encoding method more flexibly in order to ensure a free space in the recording medium. However, Japanese Patent Laid-Open No. 2008-109195 relates to a configuration for changing the encoding method according to the content of a compression target, without taking into consideration changing the encoding method in order to ensure a free space in the recording medium.